<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.video.bean.UserInfo" %>
<html>
<head>
    <title>个人中心</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/layui.css">
</head>
<body>
    <%
        UserInfo user = (UserInfo)session.getAttribute("user");
    %>

    <form class="layui-form" action="${pageContext.request.contextPath}/updateUserInfoByUsername.do" method="post" enctype="multipart/form-data">
        <div class="layui-form-item">
            <label class="layui-form-label">密码</label>
            <div class="layui-input-block">
                <input class="layui-input" type="password" name="password" placeholder="请输入密码" value="${user.password}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">姓名</label>
            <div class="layui-input-block">
                <input class="layui-input" type="text" name="name" placeholder="请输入姓名" value="${user.name}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">性别</label>
            <div class="layui-input-block">
                <input type="radio" name="sex" value="男" title="男">
                <input type="radio" name="sex" value="女" title="女">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">头像</label>
            <div class="layui-input-block">
                <input class="layui-input" type="file" name="headImage">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <input class="layui-btn" type="submit" value="提交">
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
    <div>
        <img style="padding-left:50px;" width="400px" height="300px" src="${user.headImgAddress}">
    </div>
    <script src="${pageContext.request.contextPath}/layui/layui.js"></script>
    <script>
        layui.use(['form','jquery','layer'], function(){
            var form = layui.form,
                layer = layui.layer,
                $ = layui.jquery;
            form.render();

            //监听重置
            form.on('reset(formDemo)', function(data){
                return false;
            });
        });
    </script>
</body>
</html>
